package com.practicaljava.lesson11;

import java.util.Random;

class Player{
	private PlayStrategy strategy;
	
	public void setStrategy(PlayStrategy playStrategy){
		strategy = playStrategy;
	}
	
	public int computerMove(){
	return strategy.computerMove();
	}
}

interface PlayStrategy{
	public int computerMove();
}

class Aleator implements PlayStrategy{
	
	public int computerMove() {
		Random r = new Random();
		int i = r.nextInt(9);
		System.out.println("Aleator: "+i);
		return i; 
	}
		
	}
